﻿/// <reference path="uicontrol.ts" />

module UI {

    export class Title extends UIControl {

        public type: string = 'Title';

        public text: string = '';

        public onClick: InputEvent = null;

        public onEnter: InputEvent = null;

        public onExit: InputEvent = null;

        constructor(details: any = undefined) {
            super();
            this.transparent = true;
            setupControl(this, details);
        }

        render(context: CanvasRenderingContext2D): void {
            var c = this.computed;
            context.textBaseline = 'middle';
            context.textAlign = 'left';
            context.fillStyle = UI.theme.colors.default.text;
            context.font = UI.theme.fonts.large;
            context.fillText(this.text, c.left, c.middle);
        }

    }

}